#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int x;
    int seconds;
    int minute;
    int hour;
    scanf("%d", &x);
    hour = x / 3600;
    minute = (x - hour * 3600) / 60;
    seconds = x - hour * 3600 - minute * 60;
    printf("%d %d %d\n", hour, minute, seconds);
    return 0;
}